.class public Lcom/htc/android/footprints/view/MediaControlPanelViewMode;
.super Landroid/widget/LinearLayout;
.source "MediaControlPanelViewMode.java"

# interfaces
.implements Landroid/media/MediaPlayer$OnCompletionListener;
.implements Landroid/media/MediaPlayer$OnErrorListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/htc/android/footprints/view/MediaControlPanelViewMode$OnStateChangedListener;
    }
.end annotation


# static fields
.field public static final IDLE_STATE:I = 0x0

.field public static final INTERNAL_ERROR:I = 0x2

.field private static final MSG_REFRESH:I = 0x3e9

.field private static final MSG_RESET:I = 0x3ea

.field private static final MSG_UPDATE_UI:I = 0x3e8

.field public static final NO_ERROR:I = 0x0

.field public static final PAUSE_STATE:I = 0x2

.field public static final PLAYING_STATE:I = 0x1

.field public static final SDCARD_ACCESS_ERROR:I = 0x1

.field private static final TAG:Ljava/lang/String; = "MediaControlPanelViewMode"


# instance fields
.field private mContext:Landroid/content/Context;

.field public mCurrentPosition:J

.field mCurrentTime:Landroid/widget/TextView;

.field private mFootprint:Lcom/htc/android/footprints/vo/Footprint;

.field private mLastSeekEventTime:J

.field mOnStateChangedListener:Lcom/htc/android/footprints/view/MediaControlPanelViewMode$OnStateChangedListener;

.field mPlayButton:Landroid/widget/ImageView;

.field mPlayButtonClickListener:Landroid/view/View$OnClickListener;

.field mPlayHandler:Landroid/os/Handler;

.field private mPlayer:Landroid/media/MediaPlayer;

.field private mPosOverride:J

.field mProgress:Landroid/widget/SeekBar;

.field mSeekBarChangeListener:Landroid/widget/SeekBar$OnSeekBarChangeListener;

.field mState:I

.field private mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

.field mTotoalTime:Landroid/widget/TextView;

.field mVoiceFile:Ljava/io/File;

.field public mVoiceLength:J


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 5
    .parameter "context"
    .parameter "attrs"

    .prologue
    const-wide/16 v3, -0x1

    const/4 v2, 0x0

    .line 102
    invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 49
    const/4 v0, 0x0

    iput v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    .line 55
    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    .line 57
    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    .line 59
    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButton:Landroid/widget/ImageView;

    .line 60
    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    .line 61
    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mTotoalTime:Landroid/widget/TextView;

    .line 62
    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    .line 63
    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mOnStateChangedListener:Lcom/htc/android/footprints/view/MediaControlPanelViewMode$OnStateChangedListener;

    .line 68
    iput-wide v3, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    .line 71
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentPosition:J

    .line 73
    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceFile:Ljava/io/File;

    .line 77
    new-instance v0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode$1;

    invoke-direct {v0, p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode$1;-><init>(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)V

    iput-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayHandler:Landroid/os/Handler;

    .line 232
    new-instance v0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode$2;

    invoke-direct {v0, p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode$2;-><init>(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)V

    iput-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButtonClickListener:Landroid/view/View$OnClickListener;

    .line 292
    iput-wide v3, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPosOverride:J

    .line 294
    new-instance v0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode$3;

    invoke-direct {v0, p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode$3;-><init>(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)V

    iput-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mSeekBarChangeListener:Landroid/widget/SeekBar$OnSeekBarChangeListener;

    .line 103
    iput-object p1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mContext:Landroid/content/Context;

    .line 104
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->initView()V

    .line 123
    return-void
.end method

.method static synthetic access$000(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;J)Ljava/lang/String;
    .locals 1
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 36
    invoke-direct {p0, p1, p2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setupTimer(J)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$100(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)J
    .locals 2
    .parameter "x0"

    .prologue
    .line 36
    invoke-direct {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->refreshNow()J

    move-result-wide v0

    return-wide v0
.end method

.method static synthetic access$1000(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)Lcom/htc/android/footprints/utils/StorageUtil;
    .locals 1
    .parameter "x0"

    .prologue
    .line 36
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mStorageUtil:Lcom/htc/android/footprints/utils/StorageUtil;

    return-object v0
.end method

.method static synthetic access$200(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;J)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 36
    invoke-direct {p0, p1, p2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->queueNextRefresh(J)V

    return-void
.end method

.method static synthetic access$300(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 36
    invoke-direct {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->resetMediaPanel()V

    return-void
.end method

.method static synthetic access$400(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 36
    invoke-direct {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->startPlayback()V

    return-void
.end method

.method static synthetic access$500(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 36
    invoke-direct {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->togglePlayback()V

    return-void
.end method

.method static synthetic access$600(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)J
    .locals 2
    .parameter "x0"

    .prologue
    .line 36
    iget-wide v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPosOverride:J

    return-wide v0
.end method

.method static synthetic access$602(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;J)J
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 36
    iput-wide p1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPosOverride:J

    return-wide p1
.end method

.method static synthetic access$700(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)Landroid/media/MediaPlayer;
    .locals 1
    .parameter "x0"

    .prologue
    .line 36
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    return-object v0
.end method

.method static synthetic access$800(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)J
    .locals 2
    .parameter "x0"

    .prologue
    .line 36
    iget-wide v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mLastSeekEventTime:J

    return-wide v0
.end method

.method static synthetic access$802(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;J)J
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 36
    iput-wide p1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mLastSeekEventTime:J

    return-wide p1
.end method

.method static synthetic access$900(Lcom/htc/android/footprints/view/MediaControlPanelViewMode;)Landroid/content/Context;
    .locals 1
    .parameter "x0"

    .prologue
    .line 36
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method private calVoiceLength()J
    .locals 6

    .prologue
    const-wide/16 v4, -0x1

    .line 146
    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    if-nez v2, :cond_0

    move-wide v2, v4

    .line 170
    :goto_0
    return-wide v2

    .line 152
    :cond_0
    :try_start_0
    new-instance v1, Landroid/media/MediaPlayer;

    invoke-direct {v1}, Landroid/media/MediaPlayer;-><init>()V

    .line 153
    .local v1, player:Landroid/media/MediaPlayer;
    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceFile:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/media/MediaPlayer;->setDataSource(Ljava/lang/String;)V

    .line 154
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->prepare()V

    .line 155
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->getDuration()I

    move-result v2

    int-to-long v2, v2

    iput-wide v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    .line 156
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->getCurrentPosition()I

    move-result v2

    int-to-long v2, v2

    iput-wide v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentPosition:J

    .line 157
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->release()V
    :try_end_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2

    .line 170
    .end local v1           #player:Landroid/media/MediaPlayer;
    :goto_1
    iget-wide v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    goto :goto_0

    .line 159
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 160
    .local v0, e:Ljava/lang/IllegalArgumentException;
    invoke-virtual {v0}, Ljava/lang/IllegalArgumentException;->printStackTrace()V

    goto :goto_1

    .line 161
    .end local v0           #e:Ljava/lang/IllegalArgumentException;
    :catch_1
    move-exception v2

    move-object v0, v2

    .line 162
    .local v0, e:Ljava/lang/IllegalStateException;
    invoke-virtual {v0}, Ljava/lang/IllegalStateException;->printStackTrace()V

    .line 163
    iput-wide v4, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    .line 164
    iput-wide v4, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentPosition:J

    goto :goto_1

    .line 165
    .end local v0           #e:Ljava/lang/IllegalStateException;
    :catch_2
    move-exception v2

    move-object v0, v2

    .line 166
    .local v0, e:Ljava/io/IOException;
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    .line 167
    iput-wide v4, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    .line 168
    iput-wide v4, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentPosition:J

    goto :goto_1
.end method

.method private controlScreenKeepOn(I)V
    .locals 2
    .parameter "state"

    .prologue
    const/16 v1, 0x80

    .line 411
    if-nez p1, :cond_0

    .line 412
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->getContext()Landroid/content/Context;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/app/Activity;

    invoke-virtual {p0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/view/Window;->clearFlags(I)V

    .line 415
    :goto_0
    return-void

    .line 414
    .restart local p0
    :cond_0
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->getContext()Landroid/content/Context;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/app/Activity;

    invoke-virtual {p0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/view/Window;->addFlags(I)V

    goto :goto_0
.end method

.method private queueNextRefresh(J)V
    .locals 3
    .parameter "delay"

    .prologue
    const/16 v2, 0x3e9

    .line 251
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayHandler:Landroid/os/Handler;

    invoke-virtual {v1, v2}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    .line 252
    .local v0, msg:Landroid/os/Message;
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayHandler:Landroid/os/Handler;

    invoke-virtual {v1, v2}, Landroid/os/Handler;->removeMessages(I)V

    .line 253
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayHandler:Landroid/os/Handler;

    invoke-virtual {v1, v0, p1, p2}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z

    .line 254
    return-void
.end method

.method private refreshNow()J
    .locals 11

    .prologue
    .line 257
    iget-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    if-nez v6, :cond_0

    .line 258
    const-wide/16 v6, 0x1f4

    .line 287
    :goto_0
    return-wide v6

    .line 260
    :cond_0
    :try_start_0
    iget-wide v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPosOverride:J

    const-wide/16 v8, 0x0

    cmp-long v6, v6, v8

    if-gez v6, :cond_1

    iget-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v6}, Landroid/media/MediaPlayer;->getCurrentPosition()I

    move-result v6

    int-to-long v6, v6

    move-wide v1, v6

    .line 262
    .local v1, pos:J
    :goto_1
    const-wide/16 v6, 0x3e8

    const-wide/16 v8, 0x3e8

    rem-long v8, v1, v8

    sub-long v3, v6, v8

    .line 263
    .local v3, remaining:J
    const-wide/16 v6, 0x0

    cmp-long v6, v1, v6

    if-ltz v6, :cond_4

    iget-wide v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    const-wide/16 v8, 0x0

    cmp-long v6, v6, v8

    if-lez v6, :cond_4

    .line 264
    iget-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    invoke-direct {p0, v1, v2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setupTimer(J)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 266
    iget-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v6}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v6

    if-eqz v6, :cond_2

    .line 267
    iget-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    const/4 v7, 0x0

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setVisibility(I)V

    .line 276
    :goto_2
    iget-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    const-wide/16 v7, 0x3e8

    mul-long/2addr v7, v1

    iget-wide v9, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    div-long/2addr v7, v9

    long-to-int v7, v7

    invoke-virtual {v6, v7}, Landroid/widget/SeekBar;->setProgress(I)V

    :goto_3
    move-wide v6, v3

    .line 283
    goto :goto_0

    .line 260
    .end local v1           #pos:J
    .end local v3           #remaining:J
    :cond_1
    iget-wide v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPosOverride:J

    move-wide v1, v6

    goto :goto_1

    .line 270
    .restart local v1       #pos:J
    .restart local v3       #remaining:J
    :cond_2
    iget-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    invoke-virtual {v6}, Landroid/widget/TextView;->getVisibility()I

    move-result v5

    .line 271
    .local v5, vis:I
    iget-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    const/4 v7, 0x4

    if-ne v5, v7, :cond_3

    const/4 v7, 0x0

    :goto_4
    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setVisibility(I)V

    .line 273
    const-wide/16 v3, 0x1f4

    goto :goto_2

    .line 271
    :cond_3
    const/4 v7, 0x4

    goto :goto_4

    .line 278
    .end local v5           #vis:I
    :cond_4
    iget-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    const-string v7, "--:--"

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 279
    iget-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    const/16 v7, 0x3e8

    invoke-virtual {v6, v7}, Landroid/widget/SeekBar;->setProgress(I)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_3

    .line 284
    .end local v1           #pos:J
    .end local v3           #remaining:J
    :catch_0
    move-exception v6

    move-object v0, v6

    .line 285
    .local v0, ex:Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 287
    const-wide/16 v6, 0x1f4

    goto :goto_0
.end method

.method private resetMediaPanel()V
    .locals 3

    .prologue
    .line 363
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->stopPlayback()V

    .line 364
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/SeekBar;->setProgress(I)V

    .line 365
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    const-wide/16 v1, 0x0

    invoke-direct {p0, v1, v2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setupTimer(J)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 366
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButton:Landroid/widget/ImageView;

    const v1, 0x7f020128

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 367
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayHandler:Landroid/os/Handler;

    const/16 v1, 0x3e9

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 368
    return-void
.end method

.method private setError(I)V
    .locals 1
    .parameter "error"

    .prologue
    .line 423
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mOnStateChangedListener:Lcom/htc/android/footprints/view/MediaControlPanelViewMode$OnStateChangedListener;

    if-eqz v0, :cond_0

    .line 424
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mOnStateChangedListener:Lcom/htc/android/footprints/view/MediaControlPanelViewMode$OnStateChangedListener;

    invoke-interface {v0, p1}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode$OnStateChangedListener;->onError(I)V

    .line 425
    :cond_0
    return-void
.end method

.method private setIcon(I)V
    .locals 2
    .parameter "state"

    .prologue
    const v1, 0x7f020128

    .line 386
    packed-switch p1, :pswitch_data_0

    .line 399
    :goto_0
    return-void

    .line 388
    :pswitch_0
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButton:Landroid/widget/ImageView;

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_0

    .line 391
    :pswitch_1
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButton:Landroid/widget/ImageView;

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_0

    .line 394
    :pswitch_2
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButton:Landroid/widget/ImageView;

    const v1, 0x7f020129

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_0

    .line 386
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_2
        :pswitch_1
    .end packed-switch
.end method

.method private setState(I)V
    .locals 1
    .parameter "state"

    .prologue
    .line 402
    iget v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    if-ne p1, v0, :cond_0

    .line 408
    :goto_0
    return-void

    .line 404
    :cond_0
    iput p1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    .line 405
    iget v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setIcon(I)V

    .line 406
    iget v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->controlScreenKeepOn(I)V

    .line 407
    iget v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->signalStateChanged(I)V

    goto :goto_0
.end method

.method private setupTimer(J)Ljava/lang/String;
    .locals 9
    .parameter "voicelength"

    .prologue
    const-wide/16 v7, 0x3e8

    const-wide/16 v5, 0x3c

    .line 208
    const-wide/16 v0, 0x0

    cmp-long v0, p1, v0

    if-gez v0, :cond_0

    .line 209
    const-string v0, "--:--"

    .line 210
    :goto_0
    return-object v0

    :cond_0
    const-string v0, "%02d:%02d"

    const/4 v1, 0x2

    new-array v1, v1, [Ljava/lang/Object;

    const/4 v2, 0x0

    div-long v3, p1, v7

    div-long/2addr v3, v5

    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    aput-object v3, v1, v2

    const/4 v2, 0x1

    div-long v3, p1, v7

    rem-long/2addr v3, v5

    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    aput-object v3, v1, v2

    invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method private showToast(Ljava/lang/String;)V
    .locals 2
    .parameter "showmsg"

    .prologue
    .line 227
    if-eqz p1, :cond_0

    .line 228
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mContext:Landroid/content/Context;

    const/16 v1, 0xbb8

    invoke-static {v0, p1, v1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    .line 230
    :cond_0
    return-void
.end method

.method private signalStateChanged(I)V
    .locals 1
    .parameter "state"

    .prologue
    .line 418
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mOnStateChangedListener:Lcom/htc/android/footprints/view/MediaControlPanelViewMode$OnStateChangedListener;

    if-eqz v0, :cond_0

    .line 419
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mOnStateChangedListener:Lcom/htc/android/footprints/view/MediaControlPanelViewMode$OnStateChangedListener;

    invoke-interface {v0, p1}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode$OnStateChangedListener;->onStateChanged(I)V

    .line 420
    :cond_0
    return-void
.end method

.method private startPlayback()V
    .locals 7

    .prologue
    const/4 v6, 0x0

    const/4 v5, 0x1

    .line 440
    new-instance v1, Landroid/media/MediaPlayer;

    invoke-direct {v1}, Landroid/media/MediaPlayer;-><init>()V

    iput-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    .line 441
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceFile:Ljava/io/File;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceFile:Ljava/io/File;

    invoke-virtual {v1}, Ljava/io/File;->length()J

    move-result-wide v1

    const-wide/16 v3, 0x0

    cmp-long v1, v1, v3

    if-nez v1, :cond_1

    .line 442
    :cond_0
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    if-eqz v1, :cond_3

    new-instance v1, Ljava/io/File;

    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v2, v2, Lcom/htc/android/footprints/vo/Footprint;->mAudioPath:Ljava/lang/String;

    invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_3

    .line 443
    new-instance v1, Ljava/io/File;

    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v2, v2, Lcom/htc/android/footprints/vo/Footprint;->mAudioPath:Ljava/lang/String;

    invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    iput-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceFile:Ljava/io/File;

    .line 449
    :cond_1
    :try_start_0
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceFile:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/media/MediaPlayer;->setDataSource(Ljava/lang/String;)V

    .line 450
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1, p0}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V

    .line 451
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1, p0}, Landroid/media/MediaPlayer;->setOnErrorListener(Landroid/media/MediaPlayer$OnErrorListener;)V

    .line 452
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->prepare()V

    .line 453
    iget v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    if-nez v1, :cond_2

    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    invoke-virtual {v1}, Landroid/widget/SeekBar;->getProgress()I

    move-result v1

    if-eqz v1, :cond_2

    .line 454
    iget-wide v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    iget-object v3, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    invoke-virtual {v3}, Landroid/widget/SeekBar;->getProgress()I

    move-result v3

    int-to-long v3, v3

    mul-long/2addr v1, v3

    const-wide/16 v3, 0x3e8

    div-long/2addr v1, v3

    iput-wide v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPosOverride:J

    .line 455
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    iget-wide v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPosOverride:J

    long-to-int v2, v2

    invoke-virtual {v1, v2}, Landroid/media/MediaPlayer;->seekTo(I)V

    .line 456
    const-wide/16 v1, -0x1

    iput-wide v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPosOverride:J

    .line 459
    :cond_2
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->start()V
    :try_end_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    .line 470
    invoke-direct {p0, v5}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setState(I)V

    .line 471
    :cond_3
    :goto_0
    return-void

    .line 460
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 461
    .local v0, e:Ljava/lang/IllegalArgumentException;
    const/4 v1, 0x2

    invoke-direct {p0, v1}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setError(I)V

    .line 462
    iput-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    goto :goto_0

    .line 464
    .end local v0           #e:Ljava/lang/IllegalArgumentException;
    :catch_1
    move-exception v1

    move-object v0, v1

    .line 465
    .local v0, e:Ljava/io/IOException;
    invoke-direct {p0, v5}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setError(I)V

    .line 466
    iput-object v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    goto :goto_0
.end method

.method private togglePlayback()V
    .locals 2

    .prologue
    .line 474
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    if-nez v1, :cond_1

    .line 491
    :cond_0
    :goto_0
    return-void

    .line 476
    :cond_1
    iget v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    if-eqz v1, :cond_0

    .line 479
    :try_start_0
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 480
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->pause()V

    .line 481
    const/4 v1, 0x2

    invoke-direct {p0, v1}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setState(I)V
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 487
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 488
    .local v0, e:Ljava/lang/IllegalStateException;
    invoke-virtual {v0}, Ljava/lang/IllegalStateException;->printStackTrace()V

    goto :goto_0

    .line 483
    .end local v0           #e:Ljava/lang/IllegalStateException;
    :cond_2
    :try_start_1
    iget-object v1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->start()V

    .line 485
    const/4 v1, 0x1

    invoke-direct {p0, v1}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setState(I)V
    :try_end_1
    .catch Ljava/lang/IllegalStateException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0
.end method


# virtual methods
.method public closeMediaPanel()V
    .locals 3

    .prologue
    .line 217
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->stopPlayback()V

    .line 218
    :cond_0
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceFile:Ljava/io/File;

    .line 219
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/SeekBar;->setProgress(I)V

    .line 220
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    const-wide/16 v1, 0x0

    invoke-direct {p0, v1, v2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setupTimer(J)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 221
    iget v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setIcon(I)V

    .line 222
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayHandler:Landroid/os/Handler;

    const/16 v1, 0x3e9

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 224
    return-void
.end method

.method public disableMediaControl()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 357
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButton:Landroid/widget/ImageView;

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setEnabled(Z)V

    .line 358
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    invoke-virtual {v0, v1}, Landroid/widget/SeekBar;->setEnabled(Z)V

    .line 359
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    invoke-virtual {v0, v1}, Landroid/widget/SeekBar;->setPressed(Z)V

    .line 360
    return-void
.end method

.method public getCurrentState()I
    .locals 1

    .prologue
    .line 506
    iget v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    return v0
.end method

.method initView()V
    .locals 6

    .prologue
    const-wide/16 v4, 0x0

    .line 126
    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mContext:Landroid/content/Context;

    const-string v3, "layout_inflater"

    invoke-virtual {v2, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    .line 129
    .local v0, inflater:Landroid/view/LayoutInflater;
    const v2, 0x7f03001b

    const/4 v3, 0x0

    invoke-virtual {v0, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/view/ViewGroup;

    .line 130
    .local v1, layout:Landroid/view/ViewGroup;
    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->addView(Landroid/view/View;)V

    .line 131
    const v2, 0x7f0c0088

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mTotoalTime:Landroid/widget/TextView;

    .line 132
    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mTotoalTime:Landroid/widget/TextView;

    invoke-direct {p0, v4, v5}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setupTimer(J)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 133
    const v2, 0x7f0c0087

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    .line 134
    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    invoke-direct {p0, v4, v5}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setupTimer(J)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 136
    const v2, 0x7f0c0080

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButton:Landroid/widget/ImageView;

    .line 137
    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButton:Landroid/widget/ImageView;

    iget-object v3, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButtonClickListener:Landroid/view/View$OnClickListener;

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 139
    const v2, 0x7f0c0089

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/SeekBar;

    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    .line 140
    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    invoke-virtual {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f0200bc

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/SeekBar;->setThumb(Landroid/graphics/drawable/Drawable;)V

    .line 141
    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    iget-object v3, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mSeekBarChangeListener:Landroid/widget/SeekBar$OnSeekBarChangeListener;

    invoke-virtual {v2, v3}, Landroid/widget/SeekBar;->setOnSeekBarChangeListener(Landroid/widget/SeekBar$OnSeekBarChangeListener;)V

    .line 142
    iget v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mState:I

    invoke-direct {p0, v2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setIcon(I)V

    .line 143
    return-void
.end method

.method public onCompletion(Landroid/media/MediaPlayer;)V
    .locals 3
    .parameter "mp"

    .prologue
    .line 371
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->stopPlayback()V

    .line 372
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mProgress:Landroid/widget/SeekBar;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/SeekBar;->setProgress(I)V

    .line 373
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentTime:Landroid/widget/TextView;

    const-wide/16 v1, 0x0

    invoke-direct {p0, v1, v2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setupTimer(J)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 374
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButton:Landroid/widget/ImageView;

    const v1, 0x7f020128

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 375
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayHandler:Landroid/os/Handler;

    const/16 v1, 0x3e9

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 376
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayHandler:Landroid/os/Handler;

    const/16 v1, 0x3e8

    invoke-virtual {v0, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    .line 377
    return-void
.end method

.method public onError(Landroid/media/MediaPlayer;II)Z
    .locals 2
    .parameter "mp"
    .parameter "what"
    .parameter "extra"

    .prologue
    .line 380
    invoke-direct {p0, p2}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setError(I)V

    .line 381
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayButton:Landroid/widget/ImageView;

    const v1, 0x7f020128

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 382
    const/4 v0, 0x0

    return v0
.end method

.method public setAudioData(Lcom/htc/android/footprints/vo/Footprint;)V
    .locals 8
    .parameter "data"

    .prologue
    const-wide/16 v6, 0x0

    const-wide/16 v4, -0x1

    .line 174
    if-nez p1, :cond_1

    .line 204
    :cond_0
    :goto_0
    return-void

    .line 176
    :cond_1
    iput-object p1, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    .line 177
    invoke-static {p1}, Lcom/htc/android/footprints/utils/FootprintUtils;->checkAudioData(Lcom/htc/android/footprints/vo/Footprint;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 178
    new-instance v2, Ljava/io/File;

    iget-object v3, p1, Lcom/htc/android/footprints/vo/Footprint;->mAudioPath:Ljava/lang/String;

    invoke-direct {v2, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    iput-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceFile:Ljava/io/File;

    .line 180
    new-instance v1, Landroid/media/MediaPlayer;

    invoke-direct {v1}, Landroid/media/MediaPlayer;-><init>()V

    .line 182
    .local v1, player:Landroid/media/MediaPlayer;
    :try_start_0
    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceFile:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/media/MediaPlayer;->setDataSource(Ljava/lang/String;)V

    .line 183
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->prepare()V

    .line 184
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->getDuration()I

    move-result v2

    int-to-long v2, v2

    iput-wide v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    .line 185
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->getCurrentPosition()I

    move-result v2

    int-to-long v2, v2

    iput-wide v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentPosition:J

    .line 186
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->release()V
    :try_end_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2

    .line 187
    const/4 v1, 0x0

    .line 202
    :goto_1
    iget-object v2, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayHandler:Landroid/os/Handler;

    const/16 v3, 0x3e8

    invoke-virtual {v2, v3}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    goto :goto_0

    .line 188
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 189
    .local v0, e:Ljava/lang/IllegalArgumentException;
    invoke-virtual {v0}, Ljava/lang/IllegalArgumentException;->printStackTrace()V

    .line 190
    iput-wide v4, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    .line 191
    iput-wide v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentPosition:J

    goto :goto_1

    .line 192
    .end local v0           #e:Ljava/lang/IllegalArgumentException;
    :catch_1
    move-exception v2

    move-object v0, v2

    .line 193
    .local v0, e:Ljava/lang/IllegalStateException;
    invoke-virtual {v0}, Ljava/lang/IllegalStateException;->printStackTrace()V

    .line 194
    iput-wide v4, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    .line 195
    iput-wide v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentPosition:J

    goto :goto_1

    .line 196
    .end local v0           #e:Ljava/lang/IllegalStateException;
    :catch_2
    move-exception v2

    move-object v0, v2

    .line 197
    .local v0, e:Ljava/io/IOException;
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    .line 198
    iput-wide v4, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mVoiceLength:J

    .line 199
    iput-wide v6, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mCurrentPosition:J

    goto :goto_1
.end method

.method public stopPlayback()V
    .locals 1

    .prologue
    .line 494
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    if-nez v0, :cond_0

    .line 501
    :goto_0
    return-void

    .line 497
    :cond_0
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->stop()V

    .line 498
    iget-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->release()V

    .line 499
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->mPlayer:Landroid/media/MediaPlayer;

    .line 500
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/MediaControlPanelViewMode;->setState(I)V

    goto :goto_0
.end method
